home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Telnet / NCSA / tn3270 2.4d7 source / tn3270 / globals.c < prev    next >
Text File  |  1992-04-17  |  8KB  |  198 lines

  1. /*
  2.  *  tn3270 for the Macintosh Source Code
  3.  *  Brown University Computing and Information Services
  4.  *  Version 2.4d7  April, 1992
  5.  *  Copyright (c) 1988, 1989, 1990, 1991, 1992 by Brown University and by
  6.  *  Peter John DiCamillo.
  7.  *
  8.  *  Permission is granted to any individual or institution to use, copy,
  9.  *  or redistribute the binary version of this software and its
  10.  *  documentation provided this notice and the copyright notices are
  11.  *  retained.  Permission is granted to any individual or non-profit
  12.  *  institution to use, copy, modify, or redistribute the source files
  13.  *  of this software provided this notice and the copyright notices are
  14.  *  retained.  This software may not be distributed for profit, either
  15.  *  in original form or in derivative works, nor can the source be
  16.  *  distributed to other than an individual or a non-profit institution.
  17.  *  Any  individual or group interested in seeing and/or using these
  18.  *  source files but who are prevented from doing so by the above
  19.  *  constraints should contact Don Wolfe, Assistant Vice-President for
  20.  *  Computer Systems at Brown University, (401) 863-7250, for possible
  21.  *  software licensing of the source developed at Brown.
  22.  *
  23.  *  Brown University and Peter John DiCamillo make no representations
  24.  *  about the suitability of this software for any purpose.
  25.  *
  26.  *  BROWN UNIVERSITY AND PETER JOHN DICAMILLO GIVE NO WARRANTY, EITHER
  27.  *  EXPRESS OR IMPLIED, FOR THE PROGRAM AND/OR DOCUMENTATION PROVIDED,
  28.  *  INCLUDING, WITHOUT LIMITATION, WARRANTY OF MERCHANTABILITY AND
  29.  *  WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE.
  30.  *
  31.  */
  32.  
  33. #include "maclib.h"
  34. #include "termdef.h"
  35.  
  36. char done;                        /* flag for mainline to return */
  37. cnr *cplist[MAXSESSIONS];        /* pointers to connections records */
  38. cnr *menu_cplist[MAXSESSIONS+1];  /* pointers corresponding to conn. menu */
  39. Rect screenRect;
  40. Rect dragRect;
  41. MenuHandle myMenus[NMENUS];
  42. MenuHandle kybdMenu;
  43. MenuHandle nlMenu;
  44. MenuHandle configMenu;
  45. EventRecord myEvent;
  46. Cursor *normcurs;                /* default Macintosh cursor (arrow) */
  47. char dfltcurs;                    /* flag to keep track of cursor */
  48. RgnHandle temprgn;                /* work region */
  49. scrapline * scrapstart;
  50. short scrapalloc;
  51. short scrapsize;
  52. short scrapwidth;
  53. char scrap_stdfont;
  54. char scrap_repnull;
  55. Handle scrap_nlhandle;
  56. unsigned char scrap_nltab[256];
  57. char specmenu = 0;                /* "special" menu inserted */
  58. char ScrDmpSav;                    /* saved ScrDmpEnb byte */
  59. char sw_bgrnd;                    /* running in switcher background */
  60. char sw_upd;                    /* update occurred in background */
  61. char sw_beep;                    /* beep occurred in background */
  62. Point mousehit;                    /* last hit in dialog box */
  63. char colormac;                    /* true if we have color QuickDraw */
  64. char newroms;                    /* Mac has 128K ROMs or newer */
  65. unsigned char syslevel;            /* level of system software (1st digit) */
  66. char newkybd;                    /* new (ADB) keyboard in use */
  67. char extkybd;                    /* extended ADB keyboard in use */
  68. char mf_bgrnd;                    /* in background under MultiFinder */
  69. char ftpcopen;                    /* FTP control connection open */
  70. char ftpdopen;                    /* FTP data connection open */
  71. char ftplopen;                    /* FTP list connection open */
  72. THPrint hPrint;                    /* print record handle */
  73. char prtinit;                    /* flag for printing intialization */
  74. short rowmax9;                    /* maximum no. of rows for 9-point font */
  75. short colmax9;                    /* maximum no. of columns for 9-pt. font */
  76. short rowmax12;                    /* maximum no. of rows for 12-point font */
  77. short colmax12;                    /* maximum no. of columns for 12-pt. font */
  78. Handle xtabh;                    /* handle to EBCDIC to Mac ASCII xtab */
  79. Handle alaxtabh;                /* handle to ALA diacritic table */
  80. char sndactive;                    /* true while sound is being played */
  81. SndChannelPtr scp;                /* pointer for async sound channel */
  82. char smgr_sppc;                    /* true if session manager registered ok */
  83. short smgrrefnum;                /* session manager SPPC refnum */
  84. char gestaltavail;                /* Gestalt is available */
  85. char ppcavail;                    /* PPC is available */
  86. unsigned long ppcflags;            /* PPC flags from Gestalt */
  87. char smgrppc;                    /* true if session mananger opened a port */
  88. short smgrpref;                    /* port refnum for session manager */
  89. queueinfo paramqueue;            /* PPC param block queue */
  90. queueinfo clientqueue;            /* PPC client record queue */
  91. queueinfo dataqueue;            /* PPC data block queue */
  92. char haveserial;                /* serial driver present */
  93. char havetcp;                    /* TCP/IP driver present */
  94. char havesa;                    /* standalone driver present */
  95. Handle default_kybdhandle;        /* handle to default keyboard mapping */
  96. cnr *pictcp;                    /* pointer for saving graphics */
  97. unsigned char dbgmsg[256];        /* buffer for debug messages */
  98. char pasteok;                    /* paste is possible now */
  99. char usemyscrap;                /* do paste from private scrap */
  100. char writedebug;                /* enable write tracing */
  101.  
  102.                                 /* config. connection settings */
  103.                                 /* (nearly all have effects before they could
  104.                                    be changed during a session) */
  105. unsigned char cf_hostname[256];        /* host name */
  106. unsigned char cf_wtitle[256];        /* window name */
  107. char cf_dblevel;                    /* debug level */
  108. char cf_setsflg;                    /* connection mode */
  109. unsigned char cf_timeout;            /* seconds between retransmits */
  110. unsigned char cf_retries;            /* number of retries */
  111. short cf_dfltptsize;                /* default screen point size */
  112. short cf_altptsize;                    /* alternate screen point size */
  113. short cf_altrows;                    /* rows for alternate screen */
  114. short cf_altcols;                    /* columns for alternate screen */
  115. short cf_custrows;                    /* custom row size */
  116. short cf_custcols;                    /* custom column count */
  117. char cf_windmax;                    /* always use maximum window size */
  118. char cf_savewpos;                    /* save window position in file */
  119. char cf_ext3270;                    /* extended data stream support */
  120. char cf_nographics;                    /* don't allocate graphics bitmap */
  121. char cf_nocolor;                    /* bitmaps only 1 bit deep */
  122.  
  123.  
  124.                                 /* configuration settings from API open */
  125. OpenRequest apiopenreq;
  126. unsigned char apihostname[256];
  127. unsigned char apiwindowname[256];
  128. short apiopenrefnum;                /* SPPC client refnum for open */
  129. unsigned long apiopenmsgid;            /* SPPC/PPC message id of open request */
  130. char apiopenkind;                    /* 0 = PPC, 1 = SPPC */
  131. unsigned long apiopensref;            /* PPC session refnum for open */
  132.  
  133.                                 /* work variables for new settings */
  134. settings_list ns;
  135. unsigned char nshostname[256];
  136. unsigned char nswtitle[256];
  137. unsigned char nskybdname[256];
  138. unsigned char nsnlname[256];
  139. unsigned char nssndname[256];
  140.  
  141. /* default settings */
  142.  
  143. settings_list ds = {
  144.     {0x00, 0x40,     /* attributes */
  145.      0x80, 0x20, 
  146.      0x30, 0x10,
  147.      0x80},
  148.     0,                /* dblevel */
  149.     2,                /* setsflg  (set by ioinit) */
  150.     1,                /* timeout */
  151.     15,                /* retries */
  152.     1,                /* insreset */
  153.     1,                /* impnull */
  154.     1,                /* digitpfk */
  155.     23,                /* mousepf */
  156.     0,                /* basecolor */
  157.     1,                /* exactcolor */
  158.     DFLTWHITE,        /* usrwhite */
  159.     DFLTYELLOW,        /* usryellow */
  160.     DFLTPINK,        /* usrpink */
  161.     DFLTTURQUOISE,    /* usrturquoise */
  162.     DFLTGREEN,        /* usrgreen */
  163.     DFLTRED,        /* usrred */
  164.     DFLTBLUE,        /* usrblue */
  165.     DFLTBLACK,        /* usrblack */
  166.     DFLTBACK,        /* usrback */
  167.     DFLTSTAT,        /* usrstat */
  168.     12,                /* dfltptsize */
  169.     12,                /* altptsize */
  170.     24,                /* altrows */
  171.     80,                /* altcols */
  172.     24,                /* custrows */
  173.     80,                /* custcols */
  174.     0,                /* windpth */
  175.     0,                /* windptv */
  176.     0,                /* invertbw */
  177.     1,                /* stat_time */
  178.     0,                /* curpos */
  179.     0,                /* blockcurs */
  180.     1,                /* ext3270 */
  181.     1,                /* std_brack */
  182.     1,                /* windmax */
  183.     1,                /* repnull */
  184.     1,                /* savewpos */
  185.     1,                /* autoconn */    
  186.     'ttxt',            /* text_creator */
  187.     0,                /* simps */
  188.     0,                /* keepwindow */
  189.     1,                /* nographics */
  190.     0                /* nocolor */
  191.     };
  192.  
  193. unsigned char dshostname[256];        /* set to default name for default driver */
  194. unsigned char dswtitle[] = "";
  195. unsigned char dskybdname[] = "default";
  196. unsigned char dsnlname[256];
  197. unsigned char dssndname[] = "System Alert Sound";
  198.